package com.jf.apply_car.controller;

import com.jf.apply_car.service.MenuService;
import com.jf.apply_car.util.ResultJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/menu")
public class MenuController {
    @Autowired
    private MenuService menuService;

    @GetMapping("/power")
    @ResponseBody
    public ResultJson power() {
        return menuService.getMenuList();
    }

    @GetMapping("/list")
    public String list() {
        return "menu/menu-list";
    }

    @GetMapping("/page")
    @ResponseBody
    public ResultJson page() {
        return menuService.getPage();
    }
}
